/*
* 使用组合的观念来描述一个重新部署的突击兵
* */
public class Test{
    public static void main(String[] args) {
        Assault assault01 = new Assault();
        Attack attack = new Attack(assault01);
        attack.State01();
        attack.state();

        Assault assault02 = new Assault();
        Offence offence = new Offence(assault02);
        offence.State01();
        offence.state();
    }
}

class Assault{
    public void State01(){
        System.out.println("状态：血量健康");
    }
    public void State02(){
        System.out.println("状态：已部署");
    }
}
class Attack{
    private Assault assault;
    public Attack(Assault assault){
        this.assault = assault;
        System.out.println("我方薯条已部署");
    }
    public void state(){
        System.out.println("正在进攻A点");
    }
    public void State01(){
        assault.State01();
        assault.State02();
    }
}
class Offence{
    private Assault assault;
    public Offence(Assault assault){
        this.assault = assault;
    }
    public void state(){
        System.out.println("正在防守A点");
    }
    public void State01(){
        assault.State01();
        assault.State02();
    }
}




